package com.xnfh.equipment.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.xnfh.common.bean.GatDeviceValvesListBean
import com.xnfh.equipment.R
import com.xnfh.equipment.databinding.ItemSensorValueLayoutBinding

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2023/12/26 15:29
 * @UpdateUser: ziheng
 * @UpdateDate: 2023/12/26 15:29
 * @UpdateRemark: 更新说明
 */
class SensorValuesAdapter: BaseQuickAdapter<GatDeviceValvesListBean,BaseDataBindingHolder<ItemSensorValueLayoutBinding>>(
    R.layout.item_sensor_value_layout) {
    override fun convert(holder: BaseDataBindingHolder<ItemSensorValueLayoutBinding>, item: GatDeviceValvesListBean) {
        val dataBinding = holder.dataBinding
        dataBinding?.itemSensorInfoName?.text = item.Devicename
        if(item.Switchstatus == 1){
            dataBinding?.itemSensorInfoCheck?.setImageResource(R.mipmap.ic_open)
        }else{
            dataBinding?.itemSensorInfoCheck?.setImageResource(R.mipmap.ic_close)
        }
    }
}